const mysql = require('mysql2/promise');

async function checkSchema() {
  const connection = await mysql.createConnection({
    host: 'localhost',
    user: 'root',
    password: '123456',
    database: 'asset_management',
    port: 3390
  });

  try {
    console.log('=== 检查 assets 表结构 ===');
    const [columns] = await connection.execute('DESCRIBE assets');
    console.table(columns);
    
    console.log('\n=== 检查所有表 ===');
    const [tables] = await connection.execute('SHOW TABLES');
    console.table(tables);
    
  } catch (error) {
    console.error('检查失败:', error);
  } finally {
    await connection.end();
  }
}

checkSchema();
